<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th class="text-center">
                    <div>ID</div>
                </th>
                <th class="text-center" width="20%">名称</th>
                <th class="text-center" width="6%">类型</th>
                <th class="text-center" width="20%">专业/科目</th>
                <th class="text-center" width="6%">状态</th>
                <th class="text-center" width="6%">浏览/播放状态</th>
                <th class="text-center" width="17%">总时长(秒)</th>
                <th class="text-center" width="10%">视频商</th>
                <th class="text-center" width="15%">操作</th>
            </tr>
            </thead>
        </table>
        <div class="J_V_tabContent table-xScrollWrap">
            <table class="table table-bordered table-hover table-xs-content">
                <tbody id="tbody">
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center">
                        <div>&nbsp;</div>
                    </th>
                    <th class="text-center" width="20%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="20%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="6%"></th>
                    <th class="text-center" width="17%"></th>
                    <th class="text-center" width="10%"></th>
                    <th class="text-center" width="15%"></th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="9" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有素材数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="material : ${dataMap['list']}" th:attr="data-id=${material['id']},id='material-'+${material['id']}">
                    <td class="text-center">
                        <input type="checkbox" class="i-checks" name="materialId" th:value="${material['id']}">
                    </td>
                    <td class="text-center" th:text="${material['name']}"></td>
                    <td class="text-center">
                        <th:block th:each="type : ${typeList}">
                            <span th:if="${material['typeKey']}==${type.key}" th:text="${type.value}"></span>
                        </th:block>
                    </td>
                    <td class="text-center">
                        <th:block th:if="!${#lists.isEmpty(material['subjectList'])}">
                            <span class="pie" th:each="subject,subIndex : ${material['subjectList']}">
                                <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                                <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                    <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                    <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                                </th:block>
                                <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                                <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                            </span>
                        </th:block>
                        <th:block th:if="${#lists.isEmpty(material['subjectList'])}">
                            <span class="pie">—</span>
                        </th:block>
                    </td>
                    <td class="text-center" th:attr="id='status-'+${material['id']},data-status=${material['status']}">
                        <span th:if="${material['status']}==0" class="label label-default">未指定</span>
                        <span th:if="${material['status']}==1" class="label label-danger">未发布</span>
                        <span th:if="${material['status']}==2" class="label label-info">已发布</span>
                    </td>
                    <td class="text-center" th:attr="id='play-status-'+${material['id']}">
                        <span th:if="${material['playStatus']}==0" class="label label-default">未指定</span>
                        <span th:if="${material['playStatus']}==1" class="label label-info">正常</span>
                        <span th:if="${material['playStatus']}==2" class="label label-danger">冻结</span>
                    </td>
                    <td class="text-center">
                        <span th:text="${#strings.isEmpty(material['videoDuration'])?0:material['videoDuration']}"></span>
                    </td>
                    <td class="text-center">
                        <span>268云服务</span>
                    </td>
                    <td class="text-center" data-icon>
                        <a href="javascript:void(0)" th:attr="data-id=${material['id']}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>
                        <a th:href="@{/admin/course/material/initUpdate?id={id}(id=${material['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a th:if="${material['status']}==1 or ${material['status']}==0" th:attr="data-id=${material['id']},id='status-action-'+${material['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="发布">
                            <i class="fa fa-arrow-up"></i>
                        </a>
                        <a th:if="${material['status']}==2" th:attr="data-id=${material['id']},id='status-action-'+${material['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="取消发布">
                            <i class="fa fa-arrow-down"></i>
                        </a>
                        <a th:if="${material['playStatus']}==2 or ${material['playStatus']}==0" th:attr="data-id=${material['id']},id='play-status-action-'+${material['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="浏览/播放状态恢复">
                            <i class="fa fa-history"></i>
                        </a>
                        <a th:if="${material['playStatus']}==1" th:attr="data-id=${material['id']},id='play-status-action-'+${material['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="浏览/播放状态冻结">
                            <i class="fa fa-remove"></i>
                        </a>
                        <a th:attr="data-id=${material['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                            <i class="fa fa-trash"></i>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
</html>